﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SanguoshaCardsCounter
{
    public partial class MainForm : Form
    {
        private delegate void InitCardsDeleHandler(bool isEX, bool isEXChanged);
        InitCardsDeleHandler InitCards;

        private bool EXChanged = false;

        public MainForm()
        {
            InitializeComponent();

            Cards Peach = new Cards("桃", 8, 12, tableLayoutPanel, 1);
            Cards NothingCanStopMe = new Cards("无懈可击", 4, 7, tableLayoutPanel, 2);
            Cards Liquor = new Cards("酒", 0, 5, tableLayoutPanel, 3);

            InitCards += Peach.init;
            InitCards += NothingCanStopMe.init;
            InitCards += Liquor.init;

            InitCards(EX.Checked, EXChanged);
        }

        private void EX_CheckedChanged(object sender, EventArgs e)
        {
            EXChanged = true;
            InitCards(EX.Checked, EXChanged);
            EXChanged = false;
        }

        private void buttonReset_Click(object sender, EventArgs e)
        {
            InitCards(EX.Checked, EXChanged);
        }
    }
}
